package cn.edu.zust.companyservice.service.Impl;

import Company.Dto.Company;
import cn.edu.zust.companyservice.mapper.CompanyMapper;
import cn.edu.zust.companyservice.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyServiceImpl implements CompanyService {

    @Autowired
    private CompanyMapper companyMapper;

    public void deliverCompany(Company company) {
        companyMapper.delivertCompany(company);
    }

    public List<Company> getAllCompany() {
        return companyMapper.findAllCompany();
    }

    @Override
    public void sentAccountAndPassword(int id, String account, String password) {
        companyMapper.sentAccountAndPassword(id, account, password);
    }

    @Override
    public String getPasswordByAccount(String account) {
        return companyMapper.getPasswordByAccount(account);
    }

}
